Conventionally, as disclosed in, for example, Japanese Laid-Open Patent Publication No. 2002-153673 (hereinafter, referred to as Patent Document 1), a game apparatus calculates an action of a player throwing a punch, based on data output by an acceleration sensor, so as to allow a player to play a boxing game. The game apparatus disclosed in Patent Document 1 is structured such that a glove unit functioning as a controller of the game apparatus includes an acceleration sensor which detects an acceleration in three axial directions, (e.g., the forward/backward direction (Y-axis direction), the left/right direction (X-axis direction), and the up/down direction (Z-axis direction)). The game apparatus analyzes an output waveform output by the acceleration sensor so as to identify a type of the punch having been thrown by the player. Specifically, the game apparatus calculates, based on an output waveform represented by acceleration data detected in the Y-axis direction, a time period from a start of a punch thrown by the player to an end of the same punch. Next, the game apparatus uses an output waveform represented by acceleration data in the X-axis direction and an output waveform represented by the acceleration data in the Z-axis direction. This data is also obtained in the time period from the start of the punch thrown by the player to the end of the same punch. The output waveform is used to extract data representing, for example, a maximum value, a minimum value, an amplitude, the number of times a peak appears, and an integration value. The game apparatus identifies the type of the punch (straight punch, hook punch and upper punch) based on the extracted data and a waveform pattern obtained for each of the types of punches. After the identification of the type of the punch, the game apparatus performs a game process based on the type of the punch having been identified.
In the game apparatus disclosed in Patent Document 1, when the player finishes the punch action, the type of the punch is identified, and thereafter the game process based on the identified type of the punch is performed. Therefore, when a displayed opponent character is affected based on the punch action, a slight delay may occur after the player performs the punch action. In a game such as an action game or a fighting game requiring a quick response to an input made by a player, a slow response may make the game less enjoyable.
Further, when the aforementioned game apparatus represents and displays a punch thrown by a character controlled by the player, it is necessary to render an image representing the punch action based on the type of the punch after the player finishes the punch action. Thus, the representation and display of the user's action may be increasingly delayed.
Therefore, one aspect of the illustrative embodiments provides a storage medium having an acceleration data processing program stored thereon, a storage medium having a game program stored thereon, and an acceleration data processing apparatus used to quickly represent an action of a player in a game.
The illustrative embodiments may include the following features. The reference numerals, step numbers and the like in the parentheses indicate the correspondence with the illustrative embodiments described below in order to aid in understanding the illustrative embodiments and are not intended to limit, in any way, the scope of the present invention.
A first illustrative embodiment is directed to a storage medium having stored thereon an acceleration data processing program which is executed by a computer (30) of an apparatus (5) for performing a predetermined process by using acceleration data (Da) output by an acceleration sensor (701) capable of detecting, in at least one axial direction thereof, an acceleration (accn) applied to an input device (7). The acceleration data processing program causes the computer to function as: data acquisition means (the CPU 30 for executing step 44; hereinafter step numbers are simply represented by numbers; change amount calculation means (S46); accumulation vector calculation means (S49); and direction determination means (S54). The data acquisition means acquires the acceleration data at predetermined time intervals. The change amount calculation means calculates a change amount vector (accv) representing a change amount of the acceleration by using the acceleration data having been acquired by the data acquisition means. The accumulation vector calculation means calculates an accumulation vector (vecs) by sequentially and cumulatively adding the change amount vector having been calculated by the change amount calculation means. The direction determination means determines, as a waving direction (nrm) representing a moving direction of the input device, a direction of the accumulation vector, when the accumulation vector calculated by the accumulation vector calculation means satisfies a predetermined condition (S52).
In a second illustrative embodiment, the accumulation vector calculation means includes an attenuation process means (S48). The attenuation process means sequentially attenuates the accumulation vector before or after the change amount vector is added to the accumulation vector.
In a illustrative embodiment, the acceleration sensor is capable of detecting, in at least two axial directions, the acceleration applied to the input device. The data acquisition means acquires the acceleration data outputted by the acceleration sensor in units of axial components of the at least two axial directions. The change amount calculation means calculates, as the change amount vector, the change amount of the acceleration in units of the axial components by using the acceleration represented by the acceleration data in units of the axis components. The direction determination means determines, as the waving direction representing the moving direction of the input device, a direction of a combined vector of the accumulation vectors obtained in units of the axial components.
In a fourth illustrative embodiment, the accumulation vector calculation means includes an attenuation process means. The attenuation process means sequentially attenuates the accumulation vector before or after the change amount vector is added to the accumulation vector.
In a fifth illustrative embodiment, the computer is caused to further function as gravity direction calculation means (S45). The graviton direction calculation means calculates, by using the acceleration data having been acquired by the data acquisition means, a direction of a gravitational acceleration applied to the input device. The direction determination means determines the waving direction, representing the moving direction of the input device, relative to the gravitational acceleration by using the direction of the accumulation vector, and the direction of the gravitational acceleration having been calculated by the gravity direction calculation means.
In a sixth illustrative embodiment, the direction determination means determines, as the waving direction representing the moving direction of the input device, the direction of the accumulation vector when a magnitude (sp) of the accumulation vector having been calculated by the accumulation vector calculation means is greater than a threshold value (spmax).
In a seventh illustrative embodiment, the computer is caused to further function as threshold value updating means (S51, S53). The threshold value updating means updates the threshold value so as to represent the magnitude of the accumulation vector when the magnitude of the accumulation vector having been calculated by the accumulation vector calculation means is greater than the threshold value.
In an eighth illustrative embodiment, the threshold value updating means (S51) reduces the threshold value by a predetermined amount each time the accumulation vector is calculated.
In a ninth illustrative embodiment, the threshold value updating means previously has set a fixed value (1.9) other than the threshold value. The direction determination means determines, as the waving direction representing the moving direction of the input device, the direction of the accumulation vector when the magnitude of the accumulation vector having been calculated by the accumulation vector calculation means is greater than both the threshold value and the fixed value.
In a tenth illustrative embodiment, the computer is caused to further function as: elapsed time measurement means (S43, S55) and information processing means (S56). The elapsed time measurement means measures an elapsed time (c) from when the direction determination means has determined the waving direction representing the moving direction of the input device. When the elapsed time increases to a predetermined amount, the information processing means performs predetermined information processing by using the waving direction representing the moving direction of the input device having been determined by the direction determination means.
In an eleventh illustrative embodiment, the acceleration sensor is capable of detecting the acceleration having a magnitude which is within a predetermined measurable range. The change amount calculation means updates, when the acceleration represented by the acceleration data having been acquired by the data acquisition means has a value outside the predetermined measurable range (S81, S85, S89), the change amount vector so as to represent the change amount vector obtained by attenuating, by a predetermined amount, the change amount vector immediately preceding the change amount vector being currently calculated (S83, S87, S91).
In a twelfth illustrative embodiment, the accumulation vector calculation means calculates the accumulation vector by sequentially and cumulatively adding the change amount vector which has been calculated by the change amount calculation means and has been multiplied by a coefficient (k) (S103).
In a thirteenth illustrative embodiment, the acceleration sensor is capable of detecting, in three axial (XYZ) directions, the acceleration applied to the input device. The direction determination means determines, based on a two-dimensional plane including two axes (XY) selected from among three axes of the three axial directions, the waving direction representing the moving direction of the input device. The accumulation vector calculation means sets a value of the coefficient in accordance with a magnitude of the acceleration. The acceleration is represented by the acceleration data having been acquired by the data acquisition means and is applied in one axial (Z) direction other than directions represented by the two axes selected from among the three axes (S101).
In a fourteenth illustrative embodiment, when the magnitude of the acceleration applied in the one axial direction is zero, the accumulation vector calculation means sets the value of the coefficient to one. Further, when the magnitude of the acceleration applied in the one axial direction is greater than zero, the accumulation vector calculation means sets the value of the coefficient to a value smaller than one. In this manner, the greater the magnitude of the acceleration applied in the one axial direction is, the smaller the value of the coefficient is.
A fifteenth illustrative embodiment is directed to a storage medium having stored thereon a game program, including the acceleration data processing program based on the first aspect, for causing the computer to perform a predetermined game process by using the acceleration data. The game program causes the computer to further function as a game process means (S56). The game process means performs the predetermined game process by using the waving direction representing the moving direction of the input device having been determined by the direction determination means.
In a sixteenth illustrative embodiment, the game process means includes: object setting means; object moving means; and display control means. The object setting means sets a game object (OBJ, W) in a virtual game world. The object moving means moves the game object in the virtual game world in accordance with the waving direction representing the moving direction of the input device having been determined by the direction determination means. The display control means displays the game object in the virtual game world on a display device (2) (FIG. 10A, FIG. 10B, FIG. 11)
In a seventeenth illustrative embodiment, the game process means includes: object setting means; object operating means; and display control means. The object setting means sets a game object in a virtual game world. The object operating means operates the game object in the virtual game world so as to be waved in accordance with the waving direction representing the moving direction of the input device having been determined by the direction determination means. The display control means displays the game object in the virtual game world on a display device (FIG. 9).
In an eighteenth illustrative embodiment, the game process means includes sound generation setting means and sound control means. The sound generation setting means sets, in accordance with the waving direction representing the moving direction of the input device having been determined by the direction determination means, a sound to be generated. The sound control means generates, from a speaker (2a, 706), the sound having been set by the sound generation setting means.
A nineteenth illustrative embodiment is directed to an acceleration data processing apparatus for performing a predetermined process by using acceleration data output by an acceleration sensor capable of detecting, in at least one axial direction thereof, an acceleration applied to an input device. The acceleration data processing apparatus comprises: data acquisition means; change amount calculation means; accumulation vector calculation means; and direction determination means. The data acquisition means acquires the acceleration data at predetermined time intervals. The change amount calculation means calculates a change amount vector representing a change amount of the acceleration by using the acceleration data having been acquired by the data acquisition means. The accumulation vector calculation means calculates an accumulation vector by sequentially and cumulatively adding the change amount vector having been calculated by the change amount calculation means. The direction determination means determines, as a waving direction representing a moving direction of the input device, a direction of the accumulation vector, when the accumulation vector having been calculated by the accumulation vector calculation means satisfies a predetermined condition.
In a twentieth illustrative embodiment, the accumulation vector calculation means includes an attenuation process means. The attenuation process means sequentially attenuates the accumulation vector before or after the change amount vector is added to the accumulation vector.
In a twenty-first illustrative embodiment, the acceleration sensor is capable of detecting, in at least two axial directions, an acceleration applied to the input device. The data acquisition means acquires the acceleration data output by the acceleration sensor in units of axial components of the at least two axial directions. The change amount calculation means calculates, as the change amount vector, the change amount of the acceleration in units of the axial components by using the acceleration represented by the acceleration data in units of the axial components. The direction determination means determines, as the waving direction representing the moving direction of the input device, a direction of a combined vector of the accumulation vectors obtained in units of the axial components.
According to the first illustrative embodiment, the input device including the acceleration sensor uses the accumulation vector obtained by cumulatively adding the change amount of the acceleration having been detected, and therefore it is possible to determine the waving direction representing the moving direction of the input device with enhanced responsiveness.
According to the third illustrative embodiment, the input device including the acceleration sensor capable of detecting the acceleration in at least two axial directions uses the accumulation vector obtained by cumulatively adding the change amount of the acceleration having been detected. Thus, the waving direction representing the moving direction of the input device can be determined in the two-dimensional direction or the three-dimensional direction.
According to the second and fourth illustrative embodiment, the waving direction is able to be determined when each of the change amounts of the accelerations detected by the acceleration sensor indicates a similar tendency. For example, when a linear movement is applied to the input device, the acceleration sensor detects an acceleration varying in the linear direction, and therefore each of the change amounts (change direction) of the accelerations indicates a similar tendency. That is, when an operation of waving the input device in the linear manner is performed, the change amount of the acceleration acquired by the acceleration sensor is cumulatively added. Thus, the linear direction representing the moving direction of the input device is able to be determined in accordance with a value obtained by the cumulative addition.
According to the fifth illustrative embodiment, it is possible to determine the waving direction representing the moving direction of the input device relative to gravity applied to the input device.
According to the sixth illustrative embodiment, when the magnitude of the accumulation vector is greater than a predetermined threshold value, the waving direction representing the moving direction of the input device is determined, thereby preventing erroneous determination of the waving direction.
According to the seventh illustrative embodiment, a maximum value of the magnitude of the accumulation vector is set as the threshold value, and therefore over-frequent determination of the waving direction(s) is prevented.
According to the eighth illustrative embodiment, the threshold value is attenuated, and therefore it is possible to sequentially make subsequent necessary determinations of the waving direction.
According to the ninth aspect, an influence on acceleration, such as gravitational acceleration, generated when an operation other than the waving operation is performed, is able to be eliminated, thereby preventing erroneous determination of the waving direction.
According to the tenth illustrative embodiment, an elapsed time from the determination of the waving direction is used as a degree of reliability of the waving direction. When it is necessary to acquire the waving direction with enhanced reliability, the waving direction calculated when the elapsed time increases to a predetermined amount is able to be used to perform information processing.
According to the eleventh illustrative embodiment, even when an acceleration having a value outside the measurable range of the acceleration sensor is generated, the acceleration is estimated such that the waving direction is able to be determined.
According to the twelfth illustrative embodiment, the waving direction based on a desired direction is able to be preferentially determined.
According to the thirteenth illustrative embodiment, it is possible to limit, to a direction based on a two-dimensional plane, the waving direction representing the moving direction of the input device to be determined.
According to the fourteenth illustrative embodiment, the smaller the acceleration applied in the direction perpendicular to the two-dimensional plane used for determining the waving direction representing the moving direction of the input device, the more the acceleration in the direction based the two-dimensional plane can be used to determine the waving direction.
According to the fifteenth illustrative embodiment, the waving direction representing the moving direction of the input device is able to be used for a game process.
According to the sixteenth illustrative embodiment, an item is able to be moved in the virtual game world in accordance with the waving direction representing the moving direction of the input device.
According to the seventeenth illustrative embodiment, an operation of, for example, waving a sword in the virtual game world is able to be performed in accordance with the waving direction representing the moving direction of the input device.
According to the eighteenth illustrative embodiment, it is possible to realize a game for allowing a sound to be output from a speaker in accordance with the waving direction representing the moving direction of the input device.
Further, the acceleration data processing apparatus according to the illustrative embodiments is capable of obtaining the same effect as the storage medium having the aforementioned acceleration data processing program stored thereon.
These and other aspects and advantages of the illustrative embodiments will become more apparent from the following detailed description of the illustrative embodiments when taken in conjunction with the accompanying drawings.